<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>基本的引用循环模型</title>
  <meta name="generator" content="editplus" />
  <meta name="author" content="" />
  <meta name="keywords" content="" />
  <meta name="description" content="" />
  <script>
var myGlobalObject;
function setupLeak() {
	myGlobalObject = document.getElementById('LeakedDiv');
	console.log(myGlobalObject);
	document.getElementById('LeakedDiv').expandoProperty = myGlobalObject;
	console.log(document.getElementById('LeakedDiv').expandoProperty);
}
function breakLeak() {
	document.getElementById('LeakedDiv').expandoProperty = null;
}
//alert(navigator.userAgent);
//alert(false == 'false');
//alert(false == undefined);
//alert(false == null);
//alert(null == undefined);
//alert(0 == '');
var foo = function() {
	return {
		a: 'b'
	};
}();
alert(foo.a);
function leakmaybe() {
	var elm = document.createElement('DIV');
	elm.onclick = function() {
		return 2 + 2;
	};
}
for (var i = 0; i < 10000; i++)
{
	leakmaybe();
}
  </script>
 </head>

 <body onload="setupLeak()">
  <div id="LeakedDiv"></div>
 </body>
</html>
